from selenium import webdriver
import time


driver = webdriver.Firefox()
driver.maximize_window()

url = 'https://www.baidu.com'
print('url :',url)
driver.get(url)

new_url = 'http://news.baidu.com/'
print('url :',new_url)
driver.get(new_url)

driver.back() # 回退
time.sleep(3)
driver.forward() # 前进
time.sleep(3)
driver.refresh() # 刷新页面
driver.quit()

